/*
 * Copyright (c) 2021 Futurewei Technologies, Inc.
 *
 * clang2mpl is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PSL v2. You may obtain a copy of Mulan PSL v2 at:
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the
 * Mulan PSL v2 for more details.
 */
// RUN: %clang2mpl --ascii --verify %s -- -Wno-unused-value --target=aarch64-linux-elf
// RUN: cat %m | %FileCheck %s
// CHECK: func &fx (var %x.kr f64 used) f32
float fx (x)
    // CHECK: LOC 2 [[# @LINE + 3 ]]{{$}}
    // CHECK-NEXT: var %x f32
    // CHECK: dassign %x 0 (cvt f32 f64 (dread f64 %x.kr))
    float x;
{
  return x / 2.0f;
}

// CHECK: func &fy (var %y.kr i32 used) i16
short fy (y)
    // CHECK: LOC 2 [[# @LINE + 3 ]]{{$}}
    // CHECK-NEXT: var %y i16
    // CHECK: dassign %y 0 (sext i32 16 (dread i32 %y.kr))
    short y;
{
  return y + 1;
}
